#include <iostream>
#include <vector>
using namespace std;

template <typename Comparable>
void insertionsort( vector<Comparable> & a, int n )
{
    int i, j;
    for ( i = 1; i < n; i++ )
    {
        Comparable tmp = a[ i ];
        for ( j = i; j > 0 && tmp < a[ j - 1 ]; j-- )
            a[ j ] = a[ j - 1 ];
        a[ j ] = tmp;
    }
}

int main( )
{
    int t, n, i;
    vector<int> a ( 1001 );
    cin >> t;
    while ( t-- )
    {
        cin >> n;
        for ( i = 0; i < n; i++ )
            cin >> a[ i ];
        insertionsort( a, n );
        cout << a[ 0 ];
        for ( i = 1; i < n; i++ )
            cout << ' ' << a[ i ];
        cout << endl;
    }
    return 0;
}
